II Something
by Clark Hugh Stiles
October 24, 2001 

The genuine article -- It's great to be back in a new century. No, I'm not going to resume the weekly schedule, which in case no one noticed was never quite accurate due to my, uh, amateurcrastination. Three point three. 

Okay, here's the infamous Disk.Menu program. It's a greatly modified ripoff of an ancient menu program that the legendary Paul Lutus hacked in AppleSoft BASIC for his FreeWriter distribution (uh, 25 years ago?). This program uses (and requires) 80 columns, ProDOS, BASIC.SYSTEM (or Beagle Compiler), and at times the Apple or Option keys. The italics below indicates control characters. If you don't know how to #### them, substitute the CHR$ equivalent (ouch!). The only important ones for the disk functions are the control-D characters for the commands, and that one is CHR$(4). Such substitutions belong outside the quotes. 

This version 5.0 (that was a little joke by the way) may have been the first to use the tiny little machine language routine POKEd into memory out of the sole DATA line near the end. All that does is speed up the screen PEEKing in 80 columns. I'm writing this in a Mac, and I'm not going to switch to the Bernie window to try to figure out exactly what I did and explain it to you. If you really need to know, send me money, or ask someone far more skilled at this than I am. 

I can't remember all of the command keys offhand, but some are obvious. Some are not. For example, Apple-Spacebar allows the direct input of a filename. This is for those occasions when the filename one needs (usually a directory) scrolls off the screen. I just tried a modification to that routine so that it's now possible to rename the highlighted file by using Apple-R (or Control-R). I've got the non-modified program running in Bernie ][ the Rescue right now, and it seems to work fine. 

Program Listing: 
1 GOSUB 65: PRINT CHR$(4)"Pr#3": PRINT : HGR : HGR2 : TEXT
2 VTAB 1: PRINT "O DiskMenu 5.0 by Clark Stiles" SPC( 55): POKE 34,1
3 PRINT "Online,Applesoft,Binary,System,Text,Integer,Calc,Word,File,Directory,etc";
4 PRINT " NVVVVVVVVVVVVVVVVVVVVVV": POKE 35,23: DIM P$(14)
5 VTAB 23: HOME : VTAB 23: VTAB 2: HTAB 1:K = 1:P = 1:T = 9:L = 2: ONERR GOTO 9
6 PRINT CHR$(4)"Prefix,S" INT ((K + 1) / 2)",D"1 * ( INT (K / 2) < K / 2) + 2 * ( INT (K / 2) = K / 2)
7 PRINT CHR$(4)"Prefix": INPUT P$(P)
8 PRINT "Slot " INT ((K + 1) / 2)", Drive "1 * ( INT (K / 2) < K / 2) + 2 * ( INT (K / 2) = K / 2)":"P$(P);:P = P + 1
9 K = K + 1: ON (K = 15) + 1 GOTO 6: POKE 216,0:E = P - (P > 1):P = 1: ON E GOTO 64
10 VTAB P + 2: HTAB 17: PRINT "O"P$(P)"N";: CALL 64780: VTAB P + 2: HTAB 17: PRINT P$(P):K = PEEK (49152)
11 ON 1 + (K = 63 OR K = 47) + (K = 13) * 2 + (K = 27) * 3 + (K = 10) * 4 + (K = 11) * 5 GOTO 10,5,14,64,12,13
12 P = P + (P < E) - (E - 1) * (P = E): GOTO 10
13 P = P - (P > 1) + (E - 1) * (P = 1): GOTO 10
14 PRINT CHR$(4)"Prefix"P$(P)
15 VTAB 23: HOME : VTAB 23
16 PRINT CHR$(4)"Catalog,T" MID$ ("BASBININTSYSTXTAWPASPADBDIR",T * 3 - 2,3):V = 19:OV = 19
17 HTAB 2: VTAB (V):K$ = "":A = PEEK (40) + PEEK (41) * 256
18 K$ = K$ + CHR$ ( PEEK (A + X) - 128): FOR X = 1 TO 7
19 CALL 768:K$ = K$ + CHR$ ( PEEK (A + X) - 128)
20 CALL 777:K$ = K$ + CHR$ ( PEEK (A + X) - 128)
21 NEXT :X = 0: POKE 36,0: IF LEFT$ (K$,1) < > " " THEN GOTO 23
22 ON V > 18 GOTO 38:V = 19: GOTO 36
23 OV = V
24 HTAB (2): INVERSE : PRINT K$;: NORMAL
25 CALL 64780:K = PEEK (49152): ON K < 28 GOTO 27
26 ON ( INT ( PEEK (49249) / 128) + INT ( PEEK (49250) / 128) + 1) GOTO 25
27 HTAB (2): PRINT K$;
28 ON K + 1 GOTO 24,40,40,40,40,24,40,62,39,40,36,37,24,45,24,5,24
29 ON K - 16 GOTO 64,43,40,40,38,24,40,24,24,24,64,47,24,24,24,43
30 ON K - 32 GOTO 24,24,24,24,24,24,24,24,24,51,24,24,24,64,67,24
31 ON K - 48 GOTO 5,5,5,5,5,5,5,51,5,5,24,24,42,24,67,24
32 ON K - 64 GOTO 40,40,40,40,24,40,62,24,40,24,24,51,24,24,5,24
33 ON K - 80 GOTO 64,43,40,40,52,24,40,24,24,24,24,47,24,24,24,24
34 ON K - 96 GOTO 40,40,40,40,24,40,62,24,40,24,24,51,24,24,5,24
35 ON K - 112 GOTO 64,443,40,40,52,24,40,24,24,24,24,47,24,24,50: GOTO 24
36 V = V + 1 * (V < 19): GOTO 17
37 V = V - 1 * (V > 2) + 17 * (V = 2): GOTO 17
38 ON L * T = 9 GOTO 47:T = VAL ( MID$ ("234567891",T,1)): GOTO 15
39 T = VAL ( MID$ ("912345678",T,1)): GOTO 15
40 T = VAL ( MID$ ("112791811311111191145116111111111",K - INT (K / 32) * 32 + 1,1)): GOTO 15
41 D = VAL ( MID$ ("1121",L + D,1)):T = 1: GOTO 14
42 VTAB 23: PRINT CHR$(4)"Catalog,T0": PRINT "Press a key...": CALL 64780: GOTO 15
43 VTAB 23: HTAB 1: PRINT ">"K$;: HTAB 17: PRINT "<Filename?"; SPC( 40);
44 HTAB 2: INPUT "";N$: ON (N$ = "") GOTO 15:ON (K=18)+(K=82)+(K=114) GOTO 53:K$ = LEFT$ (N$,15)
45 ON T GOTO 63,63,15,63,63,15,15,15
46 PRINT CHR$(4)"Prefix";K$:L = 1:T = 1: GOTO 15
47 PRINT CHR$(4)"Prefix": INPUT N$:N = LEN (N$)
48 N = N - 1: ON ( MID$ (N$,N,1) < > "/") GOTO 48
49 N$ = LEFT$ (N$,N): PRINT CHR$(4)"Prefix"N$: GOTO 15
50 PRINT CHR$(4)"Delete";K$: GOTO 15
51 PRINT CHR$(4)"Lock";K$: GOTO 15
52 PRINT CHR$(4)"Unlock";K$: GOTO 15
53 N$=LEFT$(N$,15):PRINT CHR$(4)"Rename";K$;",";N$: GOTO 15
54 PRINT CHR$(4)"Type";K$: GOTO 15:REM for example
55 REM
56 REM
57 REM
58 REM
59 REM
60 REM
61 REM
62 ON (T < > 1) + (T = 1) * 2 GOTO 15: PRINT CHR$(4)"Load"K$: END
63 PRINT CHR$(4)"Pr#3": PRINT : PRINT CHR$(4)"-";K$: END
64 PRINT CHR$(4)"Pr#3": PRINT : END
65 FOR K = 768 TO 785: READ T: POKE K,T: NEXT : RETURN
66 DATA 169,0,141,85,192,141,2,192,96,169,0,141,1,192,141,84,192,96
67 GOTO 15 

SAVE DISK.MENU 
End of Program Listing. 

The program fires up, lists the volumes, and the bottommost one is highlighted. The up and down arrows navigate the list, and the left and right arrows probably do also (I'm too lazy to check). After you've selected a volume by hitting RETURN, a file listing should appear. If the nine supported filetypes come up empty, the program ends, leaving you in the selected volume in Basic.System; to restart Disk.Menu, just type RUN and hit RETURN. 

The T key (assume all keys mentioned refer to Apple- or Control- +letter or name) lists the Text files, the S ...[Message truncated] 
